<%-- 
    Document   : ajout_ip
    Created on : 17 janv. 2015, 14:23:30
    Author     : Baptiste
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%> 
<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html> 
<html> 
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
        <title><s:text name="ajout_ip.titre1"/></title> 
        <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
        <link href="css/styles.css" rel="stylesheet" type="text/css">
    </head> 

    <body>
        <header>
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                            <span class="sr-only"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="accueil"><s:text name="accueil.titleNavBar"/></a>
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">

                            <li class="dropdown">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">
                                    <s:text name='menu.adresses'/> <span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="listAddress"><s:text name="menu.listeAdresses"/></a></li>
                                    <li class="active"><a href="#" class="active"><s:text name='menu.ajoutAdresse'/></a></li>
                                </ul>
                            </li>
                            
                            <s:if test="%{#session.droit == 'admin'}">
                                <li class="dropdown">
                                    <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-expanded="false">
                                        <s:text name='menu.utilisateurs'/> <span class="caret"></span>
                                    </a>
                                    <ul class="dropdown-menu" role="menu">
                                        <li><a href="listUsers"><s:text name="menu.listeUtilisateurs"/><span class="sr-only">(current)</span></a></li>                  
                                        <li><a href="<s:url action="inscription"/>"><s:text name='menu.ajoutUser'/></a></li>
                                    </ul>
                                </li>
                            </s:if>
                            <li><a href="apropos"><s:text name="menu.aPropos"/></a></li>
                        </ul>                  
                        <ul class="nav navbar-nav navbar-right">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><s:text name="accueil.profil"/><strong><s:property value="%{#session.user.identifiant}"/></strong><span class="caret"></span></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li>
                                        <s:url id="profil" action="profil">
                                            <s:param name="id_user" value="%{#session.user.id_user}"></s:param>                
                                        </s:url>
                                        <s:a href="%{profil}"><s:text name="accueil.myprofil"/></s:a>
                                    </li>
                                    <li>
                                        <s:url id="editProfil" action="editProfil">
                                            <s:param name="id_user" value="%{#session.user.id_user}"></s:param>                
                                        </s:url>
                                        <s:a href="%{editProfil}"><s:text name="accueil.modifierProfil"/></s:a>
                                    </li>            
                                    <li class="divider"></li>
                                    <li><a href="logout"><s:text name="accueil.deconnexion"/></a></li>
                                </ul>
                            </li>
                        </ul>
                        
                    </div><!-- /.navbar-collapse -->
                    
                </div><!-- /.container-fluid -->
            </nav>
        </header>
            
        <div id="divAjoutIp" class="page-header">
            <form name="addIp_form" action="add_ajoutip" method="post" class="form-horizontal">
                <s:push value="addressIp">
                    <s:hidden name="id_address" />
                    <fieldset>

                        <!-- Form Name -->
                        <legend style="padding : 10px;"><s:text name="ajout_ip.titre1"/></legend>
                        <div>
                            <!-- Address input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="adress"><s:text name="ajout_ip.ip"/></label>
                                <div class="col-md-4">
                                    <s:textfield id="address" name="address" cssClass="form-control input-md" placeholder="%{getText('ajout_ip.adresse')}" value="%{address}" />
                                    <span class="help-block"><s:text name="ajout_ip.libelle"/></span>  
                                </div>
                            </div>
                                
                            <!-- Netmask Input -->    
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="netmask">Masque réseau</label>
                                <div class="col-md-4">
                                    <s:textfield id="netmask" name="netmask" cssClass="form-control input-md" placeholder="%{getText('ajout_ip.netmask')}" value="%{netmask}" />
                                    <span class="help-block"><s:text name="ajout_ip.libelle"/></span>  
                                </div>
                            </div>    
                                

                            <!--  hardware input-->  
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="name_hardware">Equipement</label>
                                <div class="col-md-4">
                                    <s:textfield id="name_hardware" name="name_hardware" cssClass="form-control input-md" value="%{name_hardware}" />
                                    <span class="help-block"><s:text name="ajout_ip.hardware"/></span>  
                                </div>
                            </div>

                            <!-- Adddress type input-->
                            <div class="form-group">
                                <label class="col-md-4 control-label" for="type_address">Type d'adresse</label>
                                <div class="col-md-4">
                                    <s:select headerValue="Select type" list="# {'privée':'Privée', 'publique':'Publique'}" id="type_address" name="type_address" cssClass="form-control"/>
                                </div>
                            </div>


                            <!-- Button (Double) -->
                            <div class="form-group">
                                <label class="col-md-4 control-label" ></label>
                                <div class="col-md-4">
                                    <button type="submit" class="btn btn-primary">Enregistrer</button>
                                    <a id="cancel" class="btn btn-default" href="javascript:window.history.back();"><s:text name='general.retour'/></a>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                </s:push>
            </form>
        </div>

        <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
    </body> 
</html> 

